﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Reconciliation.Services;
using System.Text;
using System.Collections.Generic;

namespace Reconciliation.Web.Users_Control
{
    public partial class InvoiceAuditorComments : System.Web.UI.UserControl
    {
        private int InvoiceId;
        public int InvoiceID
        {
            get
            {
                return InvoiceId;
            }
            set { InvoiceId = value; }

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            lblComment.Text = "Comment: " + GetInvoiceComment(InvoiceID);
        }

        private string GetInvoiceComment(int InvoiceID)
        {
            StringBuilder strComment = new StringBuilder();
            //strComment.Append("Hello World123");

            List<InvoiceComment> invoiceCommentList = new List<InvoiceComment>();
            invoiceCommentList = Reconciliation.Services.Services.GetInvoiceCommentList(InvoiceID).ToList<Reconciliation.Services.InvoiceComment>();

            foreach (InvoiceComment cm in invoiceCommentList)
            {
                strComment.Append(cm.Comment);
            }
            return strComment.ToString();

        }
    }
}